.class public Lcom/inmobi/commons/internal/CommonsConfig;
.super Ljava/lang/Object;
.source "CommonsConfig.java"


# static fields
.field static a:Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;

.field static b:Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;


# instance fields
.field private c:Lcom/inmobi/commons/internal/ThinICEConfig;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 11
    sget-object v0, Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;->NONE:Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;

    sput-object v0, Lcom/inmobi/commons/internal/CommonsConfig;->a:Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;

    .line 12
    sget-object v0, Lcom/inmobi/commons/internal/CommonsConfig;->a:Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;

    sput-object v0, Lcom/inmobi/commons/internal/CommonsConfig;->b:Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;

    return-void
.end method

.method public constructor <init>()V
    .locals 1

    .prologue
    .line 14
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 10
    new-instance v0, Lcom/inmobi/commons/internal/ThinICEConfig;

    invoke-direct {v0}, Lcom/inmobi/commons/internal/ThinICEConfig;-><init>()V

    iput-object v0, p0, Lcom/inmobi/commons/internal/CommonsConfig;->c:Lcom/inmobi/commons/internal/ThinICEConfig;

    .line 15
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    invoke-virtual {p0, v0}, Lcom/inmobi/commons/internal/CommonsConfig;->setFromJSON(Lorg/json/JSONObject;)V

    .line 16
    return-void
.end method


# virtual methods
.method public getTic()Lcom/inmobi/commons/internal/ThinICEConfig;
    .locals 1

    .prologue
    .line 61
    iget-object v0, p0, Lcom/inmobi/commons/internal/CommonsConfig;->c:Lcom/inmobi/commons/internal/ThinICEConfig;

    return-object v0
.end method

.method public setFromJSON(Lorg/json/JSONObject;)V
    .locals 4
    .parameter

    .prologue
    .line 22
    :try_start_0
    const-string v0, "common"

    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_2

    move-result-object v0

    move-object v1, v0

    .line 28
    :goto_0
    :try_start_1
    const-string v0, "AND"

    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_2

    move-result-object v0

    .line 32
    :goto_1
    const/4 v2, 0x1

    :try_start_2
    invoke-static {v0, v1, v2}, Lcom/inmobi/commons/internal/InternalSDKUtil;->populateToNewJSON(Lorg/json/JSONObject;Lorg/json/JSONObject;Z)Lorg/json/JSONObject;
    :try_end_2
    .catch Lorg/json/JSONException; {:try_start_2 .. :try_end_2} :catch_2

    move-result-object p1

    .line 41
    :goto_2
    :try_start_3
    sget-object v0, Lcom/inmobi/commons/uid/UID;->commons:Lcom/inmobi/commons/uid/UID;

    const-string v1, "ids"

    invoke-virtual {p1, v1}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/inmobi/commons/uid/UID;->setFromJSON(Lorg/json/JSONObject;)V
    :try_end_3
    .catch Lorg/json/JSONException; {:try_start_3 .. :try_end_3} :catch_5

    .line 46
    :goto_3
    :try_start_4
    iget-object v0, p0, Lcom/inmobi/commons/internal/CommonsConfig;->c:Lcom/inmobi/commons/internal/ThinICEConfig;

    const-string v1, "tic"

    invoke-virtual {p1, v1}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/inmobi/commons/internal/ThinICEConfig;->a(Lorg/json/JSONObject;)V
    :try_end_4
    .catch Lorg/json/JSONException; {:try_start_4 .. :try_end_4} :catch_4

    .line 51
    :goto_4
    :try_start_5
    const-string v0, "ll"

    sget-object v1, Lcom/inmobi/commons/internal/CommonsConfig;->b:Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;

    invoke-virtual {v1}, Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;->getValue()I

    move-result v1

    const/4 v2, 0x0

    const/4 v3, 0x2

    invoke-static {p1, v0, v1, v2, v3}, Lcom/inmobi/commons/internal/InternalSDKUtil;->getIntFromJSON(Lorg/json/JSONObject;Ljava/lang/String;III)I

    move-result v0

    int-to-long v0, v0

    invoke-static {v0, v1}, Lcom/inmobi/commons/internal/Log;->getLogLevelValue(J)Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;

    move-result-object v0

    sput-object v0, Lcom/inmobi/commons/internal/CommonsConfig;->b:Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_3

    .line 58
    :goto_5
    return-void

    .line 23
    :catch_0
    move-exception v0

    .line 24
    :try_start_6
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    move-object v1, v0

    goto :goto_0

    .line 29
    :catch_1
    move-exception v0

    .line 30
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V
    :try_end_6
    .catch Lorg/json/JSONException; {:try_start_6 .. :try_end_6} :catch_2

    goto :goto_1

    .line 33
    :catch_2
    move-exception v0

    .line 34
    const-string v0, "IMCOMMONS_3.7.0"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Commons config is ill formed. JSON received: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_2

    .line 54
    :catch_3
    move-exception v0

    .line 55
    const-string v0, "IMCOMMONS_3.7.0"

    const-string v1, "Exception getting log level config"

    invoke-static {v0, v1}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_5

    .line 47
    :catch_4
    move-exception v0

    goto :goto_4

    .line 42
    :catch_5
    move-exception v0

    goto :goto_3
.end method

.method public setTic(Lcom/inmobi/commons/internal/ThinICEConfig;)V
    .locals 0
    .parameter

    .prologue
    .line 65
    iput-object p1, p0, Lcom/inmobi/commons/internal/CommonsConfig;->c:Lcom/inmobi/commons/internal/ThinICEConfig;

    .line 66
    return-void
.end method

.method public toJSON()Lorg/json/JSONObject;
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/json/JSONException;
        }
    .end annotation

    .prologue
    .line 69
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    .line 70
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V

    .line 71
    sget-object v2, Lcom/inmobi/commons/uid/UID;->commons:Lcom/inmobi/commons/uid/UID;

    invoke-virtual {v2}, Lcom/inmobi/commons/uid/UID;->toJSON()Lorg/json/JSONObject;

    move-result-object v2

    .line 72
    iget-object v3, p0, Lcom/inmobi/commons/internal/CommonsConfig;->c:Lcom/inmobi/commons/internal/ThinICEConfig;

    invoke-virtual {v3}, Lcom/inmobi/commons/internal/ThinICEConfig;->toJSON()Lorg/json/JSONObject;

    move-result-object v3

    .line 74
    const-string v4, "AND"

    invoke-virtual {v0, v4, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 75
    const-string v4, "common"

    new-instance v5, Lorg/json/JSONObject;

    invoke-direct {v5}, Lorg/json/JSONObject;-><init>()V

    invoke-virtual {v0, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 77
    const-string v4, "ids"

    invoke-virtual {v1, v4, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 78
    const-string v2, "tic"

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 79
    const-string v2, "ll"

    sget-object v3, Lcom/inmobi/commons/internal/CommonsConfig;->b:Lcom/inmobi/commons/internal/Log$INTERNAL_LOG_LEVEL;

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 81
    return-object v0
.end method
